Conversation
- add new @gridplus/xrp chain package (module, lattice signer plugin, shared helpers) - register xrp:lattice in SDK default chain manifest - add public SDK helpers: fetchXrpAddresses() and signXrp() - extend protocol/constants/types with SHA512HALF + XRP encoding support - gate XRP generic-signing capabilities by firmware version (>= 0.18.10) - allow XRP coin type in derivation path validation and add XRP derivation constant - add XRP e2e signing coverage and default manifest unit assertion - update docs/sidebar/architecture docs for XRP and chain-modules page - update workspace scripts/deps and pnpm lockfile for @gridplus/xrp
- replace `catch (err: any)` with `unknown` handling in general e2e tests - format xrp e2e vector literals and xrp signer queue call for biome - type xrp capability maps as `Record<string, unknown>` to satisfy typecheck
Move compressSecp256k1Pubkey to one xrp shared module and re-export from chain/devices. Replace repeated XRP e2e timeout literals with constants and localize one-off test client setup.
538af46 to
e5920e9
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e5920e9293
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| if (!legacy && gte(v, [0, 18, 10])) { | ||
| c.genericSigning.hashTypes = { | ||
| ...c.genericSigning.hashTypes, | ||
| SHA512HALF: EXTERNAL.SIGNING.HASHES.SHA512HALF, |
There was a problem hiding this comment.
Implement SHA512HALF prehash path for large payloads
Adding SHA512HALF to genericSigning.hashTypes enables XRP signing requests, but buildGenericSigningMsgRequest in packages/sdk/src/genericSigning.ts still only prehashes KECCAK256 and SHA256 when payloads exceed maxExpandedSz; for SHA512HALF it falls into Unsupported hash type.. This causes signXrp to fail for large XRPL preimages (for example transactions with large memo payloads) that require prehashing, even on firmware versions that advertise XRP/SHA512HALF support.
Useful? React with 👍 / 👎.
commit: |
Move toBuffer, parseHexBytes, buildSigResultFromRsv, and compressSecp256k1Pubkey into chain-core and re-export from each chain's devices/shared.ts so consumer imports stay unchanged.
📝 Summary
Adds first-party XRP support to
gridplus-sdkusing the new chain plugin architecture, including runtime registration, SDK helper APIs, protocol/constants updates, docs, and XRP e2e coverage.Also includes follow-up lint/typecheck fixes for XRP e2e tests.
🔧 Context / Implementation
@gridplus/xrppackages/chains/xrp/src/chain.tspackages/chains/xrp/src/devices/lattice.tspackages/chains/xrp/src/index.tspackages/sdk/src/chains/defaultManifest.tsfetchXrpAddresses(...)inpackages/sdk/src/api/addresses.tssignXrp(...)inpackages/sdk/src/api/signing.tsSHA512HALFhash supportXRPencoding supportpackages/types/*andpackages/sdk/src/constants.tspackages/docs/docs/addresses.mdpackages/docs/docs/signing.mdpackages/docs/docs/intro.mdpackages/docs/docs/chain-modules.md🧪 Test Plan
pnpm lintpnpm typecheckpnpm --filter gridplus-sdk run test-unitpnpm --filter gridplus-sdk run e2e-sign-xrp(with simulator and test firmware capabilities)Expected result:
fetchXrpAddressesandsignXrpwork through SDK helper APIs.🖼️ Screenshots (if applicable)